<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>全选全不选</title>
  <script type="text/javascript" src="../js/jquery-3.4.1.min.js"></script>
  <script>
    $(function(){
      $("#all").click(function (){
        $("input[type='checkbox']").prop("checked", $(this).prop("checked"));
      })
    })
  </script>
</head>
<body>
<table border="1">
  <tr>
    <th><input type="checkbox" id="all">全选</th>
    <th>编号</th>
    <th>姓名</th>
    <th>工资</th>
  </tr>
  <tr>
    <td><input type="checkbox"></td>
    <td>1</td>
    <td>admin</td>
    <td>8000</td>
  </tr>
  <tr>
    <td><input type="checkbox"></td>
    <td>2</td>
    <td>jack</td>
    <td>8000</td>
  </tr>
  <tr>
    <td><input type="checkbox"></td>
    <td>3</td>
    <td>tom</td>
    <td>8000</td>
  </tr>
  <tr>
    <td><input type="checkbox"></td>
    <td>4</td>
    <td>lucy</td>
    <td>8000</td>
  </tr>
</table>
</body>
</html>